﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace Inbox.Domain
{
    [Table(Name = "dbo.Equipment")]
    public class Equipment : PersistentObject
    {
        [Column(Storage = "Name", DbType = "NVarChar(50)", UpdateCheck = UpdateCheck.Never)]
        public string Name { get; set; }

        [Column(Storage = "EquipmentType", DbType = "Int", UpdateCheck = UpdateCheck.Never)]
        public int EquipmentType { get; set; }

        [Column(Storage = "Quantity", DbType = "Int", UpdateCheck = UpdateCheck.Never)]
        public int Quantity { get; set; }

        [Association(Name = "Equipment_Machine_Equipment", Storage = "Machine_Equipment", ThisKey = "ID", OtherKey = "Equipment_ID")]
        public EntitySet<Machine_Equipment> Machine_Equipment
        {
            get
            {
                return this.Machine_Equipment;
            }
            set
            {
                this.Machine_Equipment.Assign(value);
            }
        }

        public Equipment()
        {
            this.Machine_Equipment = new EntitySet<Machine_Equipment>();
        }
    }
}
